package tds.model7.version1;
/**
 * @Company 杭州先锋电子技术股份有限公司
 * @ClassName BootStrap
 * @Description TODO（测试装饰模式的主程序)
 * @author tds
 * @Date 2019/2/20 9:08
 * @version 1.0.0
 */
public class BootStrap {
    public static void main(String[] args) {
        ConcreateComponent c = new ConcreateComponent();
        ConcreateDecoratorA d1 = new ConcreateDecoratorA();
        ConcreateDecoratorB d2 = new ConcreateDecoratorB();

        //先用装饰d1来包装c，然后用装饰d2来包装d1，最后执行d2的operation()
        d1.setComponent(c);
        d2.setComponent(d1);
        d2.operation();
    }
}
